package kgame5.enginex.part {
import kgame5.enginex.EntityVO;
import kgame5.enginex.event.GUViewEvent;
import kgame5.enginex.event.SendCommandEvent;
import kgame5.k3d.core.obj3d.node3d.Node3D;

import flash.events.EventDispatcher;

/**
 * @author kk
 * 类比于pureMVC中的comp,用于操纵pane
 */
public class GViewComp extends EventDispatcher{
	protected var md_shadow:Node3D;//影子
	public function getNode3D():Node3D{
		return null;
	}
	public function getShadow3D():Node3D{
		return md_shadow;
	}
	//注意，实际使用中需要将vo转型成需要的类型
	public function update(vo:EntityVO):void{
		if(md_shadow!=null){
			md_shadow.x = vo.hardVO.v3d_p.x;
			md_shadow.z = vo.hardVO.v3d_p.z;
		}
	}
	//这个暂时不知道在何处用到
	public function dispose():void{
		
	}
	
	//==============向GameUnit发送事件.参考pureMVC======================
	protected function sendNotify(name:String,data:Object):void{
		this.dispatchEvent(new GUViewEvent(name,data));
	}
	
	//==================通知GUActor对外发送command=====================
	protected function sendCommand(commandName:String,data:Object):void{
		this.dispatchEvent(new SendCommandEvent(commandName,data));
	}
}
}
